<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
		<title>情满金秋，为爱而垫满500减100</title>
		<link rel="stylesheet" type="text/css" href="./css/comment.css" />
		<link rel="stylesheet" type="text/css" href="./css/goldenFall.css" />
		<script type="text/javascript" src="./js/rem.js"></script>
		
		<script type="text/javascript" src="./js/cookie.js"></script>
		<script type="text/javascript">
			// 获取url参数
			function GetQueryString(name){
				var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
				var r = window.location.search.substr(1).match(reg);
				if(r!=null)return  unescape(r[2]); return null;
			}
			// 获取相关信息
			var whereFrom = GetQueryString("from");// 来源
			var phone = GetQueryString("fromPhone");// 手机
			var _Global_;// 全局来源
			//兼容微信分享出去自带from query的冲突 singlemessage groupmessage timeline 分别对应 单人分享 微信群分享 朋友圈分享
			if (whereFrom == null || whereFrom == '' || whereFrom == 'null'|| whereFrom=='singlemessage' || whereFrom=='groupmessage' || whereFrom=='timeline') {
				_Global_ = 'web';
			} else {
				_Global_ = 'app';
				// 设置cookie 在分会场内取出使用
				setCookie('phone',phone);
			}
			// 设置cookie 在分会场内取出使用
			setCookie('siteFrom',_Global_);
		</script>
	</head>

	<body>
		<div class="mask"></div>
		<!-- 提示弹出框 -->
		<div class="promptBox">
			<p class="firstary"></p>
			<p class="secondary"></p>
			<div class="iKnow">知道了</div>
		</div>
		<div class="active-autumn">
			<div class="active-autumn-subject">
				<img src="./image/goldenFall/subject.jpg" alt="" />
			</div>
			<div class="getTickets">
				<div class="getTicket1">
					<img src="./image/goldenFall/ticket1.png" alt="" />
				</div>
				<div class="getTicket2">
					<img src="./image/goldenFall/ticket2.png" alt="" />
				</div>
			</div>
			<div class="carpField">
				<div class="carpTitle">
				</div>
				<div class="carpLists">
					<div class="carpList1">
						<img src="./image/goldenFall/carpList/p1.png" alt="" onclick="H5AppOpen('701266')" />
					</div>
					<div class="carpList2">
						<img src="./image/goldenFall/carpList/p2.png" alt="" onclick="H5AppOpen('701265')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList3">
						<img src="./image/goldenFall/carpList/p3.png" alt="" onclick="H5AppOpen('674303')" />
					</div>
					<div class="carpList4">
						<img src="./image/goldenFall/carpList/p4.png" alt="" onclick="H5AppOpen('701270')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList5">
						<img src="./image/goldenFall/carpList/p5.png" alt="" onclick="H5AppOpen('651702')" />
					</div>
					<div class="carpList6">
						<img src="./image/goldenFall/carpList/p6.png" alt="" onclick="H5AppOpen('651703')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList7">
						<img src="./image/goldenFall/carpList/p7.png" alt="" onclick="H5AppOpen('651704')" />
					</div>
					<div class="carpList8">
						<img src="./image/goldenFall/carpList/p8.png" alt="" onclick="H5AppOpen('651705')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList9">
						<img src="./image/goldenFall/carpList/p9.png" alt="" onclick="H5AppOpen('701269')" />
					</div>
					<div class="carpList10">
						<img src="./image/goldenFall/carpList/p10.png" alt="" onclick="H5AppOpen('669940')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList11">
						<img src="./image/goldenFall/carpList/p11.png" alt="" onclick="H5AppOpen('653386')" />
					</div>
					<div class="carpList12">
						<img src="./image/goldenFall/carpList/p12.png" alt="" onclick="H5AppOpen('660527')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList13">
						<img src="./image/goldenFall/carpList/p13.png" alt="" onclick="H5AppOpen('669938')" />
					</div>
					<div class="carpList14">
						<img src="./image/goldenFall/carpList/p14.png" alt="" onclick="H5AppOpen('669941')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList15">
						<img src="./image/goldenFall/carpList/p15.png" alt="" onclick="H5AppOpen('669942')" />
					</div>
					<div class="carpList16">
						<img src="./image/goldenFall/carpList/p16.png" alt="" onclick="H5AppOpen('651699')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList17">
						<img src="./image/goldenFall/carpList/p17.png" alt="" onclick="H5AppOpen('701280')" />
					</div>
					<div class="carpList18">
						<img src="./image/goldenFall/carpList/p18.png" alt="" onclick="H5AppOpen('669943')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList19">
						<img src="./image/goldenFall/carpList/p19.png" alt="" onclick="H5AppOpen('669944')" />
					</div>
					<div class="carpList20">
						<img src="./image/goldenFall/carpList/p20.png" alt="" onclick="H5AppOpen('651701')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList21">
						<img src="./image/goldenFall/carpList/p21.png" alt="" onclick="H5AppOpen('674285')" />
					</div>
					<div class="carpList22">
						<img src="./image/goldenFall/carpList/p22.png" alt="" onclick="H5AppOpen('701271')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList23">
						<img src="./image/goldenFall/carpList/p23.png" alt="" onclick="H5AppOpen('674289')" />
					</div>
					<div class="carpList24">
						<img src="./image/goldenFall/carpList/p24.png" alt="" onclick="H5AppOpen('674290')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList25">
						<img src="./image/goldenFall/carpList/p25.png" alt="" onclick="H5AppOpen('674291')" />
					</div>
					<div class="carpList26">
						<img src="./image/goldenFall/carpList/p26.png" alt="" onclick="H5AppOpen('674290')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList27">
						<img src="./image/goldenFall/carpList/p27.png" alt="" onclick="H5AppOpen('674293')" />
					</div>
					<div class="carpList28">
						<img src="./image/goldenFall/carpList/p28.png" alt="" onclick="H5AppOpen('674294')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList29">
						<img src="./image/goldenFall/carpList/p29.png" alt="" onclick="H5AppOpen('674295')" />
					</div>
					<div class="carpList30">
						<img src="./image/goldenFall/carpList/p30.png" alt="" onclick="H5AppOpen('674296')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList31">
						<img src="./image/goldenFall/carpList/p31.png" alt="" onclick="H5AppOpen('674297')" />
					</div>
					<div class="carpList32">
						<img src="./image/goldenFall/carpList/p32.png" alt="" onclick="H5AppOpen('674298')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList33">
						<img src="./image/goldenFall/carpList/p33.png" alt="" onclick="H5AppOpen('674299')" />
					</div>
					<div class="carpList34">
						<img src="./image/goldenFall/carpList/p34.png" alt="" onclick="H5AppOpen('674300')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList35">
						<img src="./image/goldenFall/carpList/p35.png" alt="" onclick="H5AppOpen('674301')" />
					</div>
					<div class="carpList36">
						<img src="./image/goldenFall/carpList/p36.png" alt="" onclick="H5AppOpen('674300')" />
					</div>
				</div>
				<div class="carpLists">
					<div class="carpList37">
						<img src="./image/goldenFall/carpList/p37.png" alt="" onclick="H5AppOpen('674302')" />
					</div>
					<div class="carpList38">
						<img src="./image/goldenFall/carpList/p38.png" alt="" onclick="H5AppOpen('701272')" />
					</div>
				</div>
				<div class="carpFooter">
					<img src="./image/goldenFall/footer.png" alt="" />
				</div>
			</div>
		</div>
		<!-- 回顶部 -->
		<div class="goTop">
			<img src="./image/goldenFall/top.png" id="gotop" alt="">
		</div>
		<!-- 登录 -->
	</body>
	<script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<!-- 二次封装跳转 -->
	<script src="./js/H5AppOpen.js" type="text/javascript"></script>
	<script src="./js/comment.js" type="text/javascript"></script>
	<script type="text/javascript">	
		var maskBg = $('.mask'),
			yoooClose = $('.close'), // 关闭弹窗
			ticket1 = false, //满300减50
			ticket2 = false //满500减100
		//返回顶部
		$(window).scroll(function() {
			var VscrollTop = $("body").scrollTop();
			if(VscrollTop > 1500) {
				$("#gotop").show();
			} else {
				$("#gotop").hide();
			}
		})
		$("#gotop").click(function() {
			$("body").scrollTop(0);
		})
		
		//立即领取
		$(".getTickets .getTicket1 img").click(function() {
			if(!commonSignIn()) return;
			ticket1 = true;
			ticket2 = false;
			if(ticket1) {
				subType = 20171050;
				subject = '满300减50'
			} else if(ticket2) {
				subType = 201710100;
				subject = '满500减100';
			}
			var phoneNumber = _Global_ == 'web' ? getCookie('userName') : phone;
			// 满秋领券
			$.ajax({
				url: getIp + '/CARNT/TempActivityWeb/autumnActivity',
				type: "post",
				dataType: "json",
				data: {
					PHONE: phoneNumber,
					SUB_TYPE: subType,
					COMP_ID: 0,
					SUBJECT: subject,
					RMK: subject
				},
				success: function(data) {
					//console.log(data);
					if(data.STATUS_CODE == 1) { // 正常返回
						promptBox('领取成功!');
					} else if(data.STATUS_CODE == 2) {
						promptBox('您已经领取过！', ' ');
					} else if(data.STATUS_CODE == 15) {
						promptBox('缺少参数！', ' ');
					} else {
						promptBox('服务器异常！', ' ');
					}
				}
			});

		})
		$(".getTickets .getTicket2 img").click(function() {
			if(!commonSignIn()) return;
			ticket2 = true;
			ticket1 = false;
			if(ticket1) {
				subType = 20171050;
				subject = '满300减50'
			} else if(ticket2) {
				subType = 201710100;
				subject = '满500减100';
			}
			var phoneNumber = _Global_ == 'web' ? getCookie('userName') : phone;
			// 满秋领券
			$.ajax({
				url: getIp + '/CARNT/TempActivityWeb/autumnActivity',
				type: "post",
				dataType: "json",
				data: {
					PHONE: phoneNumber,
					SUB_TYPE: subType,
					COMP_ID: 0,
					SUBJECT: subject,
					RMK: subject
				},
				success: function(data) {
					//console.log(data);
					if(data.STATUS_CODE == 1) { // 正常返回
						promptBox('领取成功!');
					} else if(data.STATUS_CODE == 2) {
						promptBox('您已经领取过！', ' ');
					} else if(data.STATUS_CODE == 15) {
						promptBox('缺少参数！', ' ');
					} else {
						promptBox('服务器异常！', ' ');
					}
				}
			});

		})
		// ----------------------------------------------------------------- 以下是分享部分
		//分享记录
		function saveRecord(actId, type) {
			var json = {
				'ACT_ID': actId,
				'SHARE_TYPE': type,
				'MOBILE': _Global_ == 'web' ? getCookie('userName') : phone
			}
			$.ajax({
				type: "post",
				async: false,
				dataType: "json",
				url: getIp + "/CARNT/Act/createShareRecord.action",
				data: json,
				success: function() {}
			});
		}
		// 点击数
		var json = {
			'actId': 20171105
		}

		$.ajax({
			type: "post",
			async: false,
			dataType: "json",
			url: getIp + "/CARNT/Act/updateActClick.action",
			data: json,
			success: function(data) {
				//slert("ok");
			}
		})
		var title;
		var desc;
		var imgUrl;
		var linkUrl;
		//分享文案
		$.ajax({
			type: "post",
			async: false,
			dataType: "json",
			url: getIp + "/CARNT/ActWeb/getActivityById.action",
			data: {
				ACT_ID: '20171105'
			},
			success: function(data) {
				title = data.RESULT_DATA[0].SHARE_TITLE;
				desc = data.RESULT_DATA[0].SHARE_CONTENT;
				imgUrl = data.RESULT_DATA[0].SHARE_ICON;
				linkUrl = data.RESULT_DATA[0].LINK_URL;
				document.title = title;
			}
		});
		//获取分享的文案
		var timestamp;
		var nonceStr;
		var signature;
		//这个URL是你当前页面的url
		var json = {
			'url': location.href
		}
		var u = navigator.userAgent;
		var isAndroids = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; // android终端
		var isiOSs = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
		var urls='';
		var appid='';
		if(isAndroids){
			urls='../../OAuth/getAccess_token.action';
			appid='wxf71262a112685c25';
		}else if(isiOSs){
			urls='../../OAuth/getAccess_tokenIPHONE.action';
			appid='wx054c6f61cacfa911';
		}
		$.ajax({
			type: "post",
			async: false,
			dataType: "json",
			url: urls,
			data: json,
			success: function(data) {
				timestamp = data.NOW_TIME;
				nonceStr = data.NONCESTR;
				signature = data.SKEY;
				wx.config({
					debug: false, // 开启调试模式,false调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
					appId: appid, // 必填，公众号的唯一标识
					timestamp: timestamp, // 必填，生成签名的时间戳
					nonceStr: nonceStr, // 必填，生成签名的随机串
					signature: signature, // 必填，签名，见附录1
					jsApiList: [
						'onMenuShareTimeline',
						'onMenuShareAppMessage',
						'hideOptionMenu',
						'showOptionMenu'
					]
				});
			}
		});
		wx.ready(function() {

			// 分享给朋友
			wx.onMenuShareAppMessage({
				title: title,
				desc: desc,
				link: linkUrl,
				imgUrl: imgUrl,
				trigger: function(res) {},
				success: function(res) {
					saveRecord(20171105, 1);
				},
				cancel: function(res) {},
				fail: function(res) {
					alert(JSON.stringify(res));
				}
			});

			//分享朋友圈
			wx.onMenuShareTimeline({
				title: title,
				desc: desc,
				link: linkUrl,
				imgUrl: imgUrl,
				trigger: function(res) {

				},
				success: function(res) {
					saveRecord(20171105, 1);
				},
				cancel: function(res) {},
				fail: function(res) {
					alert(JSON.stringify(res));
				}
			});
		});
	</script>

</html>